﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NorthWindEmployees
{
    public partial class _Default : System.Web.UI.Page
    {
 
        protected void Page_Load(object sender, EventArgs e)
        {
            NorthwindDataContext context = new NorthwindDataContext();
            var names =
                    from b in context.Employees
                    select new { name = b.FirstName + ' ' + b.LastName ,id=b.EmployeeID};

            if (!IsPostBack)
            {
                this.GridViewEmployees.DataSource = names;
                this.GridViewEmployees.DataBind();
            }
        }
    }
}
